<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var str = '123*abc.456';
      console.log(str.search('.*'));       // 输出结果：0
      console.log(str.search(/[\.\*]/));   // 输出结果：3
    </script>
  </body>
</html>